﻿using Application.Core;
using Domain.Models.Account;
using System.Linq;
using System.Web.Mvc;

namespace Web.Controllers
{
    public class HomeController : Controller
    {
        private ICommonService<Customer> _customerService;

        public HomeController(ICommonService<Customer> customerService)
        {
            _customerService = customerService;
        }

        public ActionResult Index()
        {
            _customerService.FindById(1);
            var customer = _customerService.Find().FirstOrDefault();
            customer.PhoneNumber = System.DateTime.Now.Ticks.ToString();
            _customerService.Update(customer);
            return View(customer);
        }
    }
}